Skip to content

workflow: hand a card's facts to the run from the panel - #2497

Merged
Birfy merged 1 commit into
ThinkFlowLab:mainfrom
HugoXK:dev/5-workflow-panel-assign-brief
Nov 5, 2026
Merged

Birfy merged 1 commit into
ThinkFlowLab:mainfrom
HugoXK:dev/5-workflow-panel-assign-brief

Conversation

@HugoXK

@HugoXK HugoXK commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #2495
Owner: Dev-5
Written-by: Dev-5
Reviewer: Birfy
Claim-Id: ecb278a60cca446e8fbdfdbe27c0c484
Risk tier: T2 — plugins/workflow/client.js sits under plugins/**; the rest is its test, one doc line and a changelog fragment.

What changed

Why the two spots move together

loadTasks (plugins/workflow/client.js:2196-2198) projected every row the host answered down to {id, title, status, priority, column}, so brief never reached the component; confirmAssign (:2249) looks the card up in exactly that list, which made task.brief permanently undefined there. Changing only the assign body would send '' on every hand-off: the facts would still not reach the run, acceptance 1 would stay red, and acceptance 2 would pass for the wrong reason. The read dropping the field and the write not carrying it are one defect.

Files (git diff --numstat e809c43a...HEAD)

  • plugins/workflow/client.js +7/−1
  • plugins/workflow/test/client.test.js +73/−5
  • docs/subsystems/workflow.md +1/−1
  • changelog.d/2495-workflow-panel-assign-brief.fixed.md +1/−0

Red first

On a clean tree at ecee1417 — the live main the branch was cut from; e809c43a only adds #2491's Settings change — with only the two new cases added (plugins/workflow):

TZ=UTC node --import ./test/resolve.mjs --test test/client.test.js

# tests 173 / # pass 171 / # fail 2:

not ok 80 - #2495: a card that holds facts hands them to the workflow verbatim
  the facts ride with the hand-off, verbatim
  + actual - expected

  + undefined
  - 'FACTS A\nSecond line.'

not ok 81 - #2495: a card with no facts sends an empty brief, so a cached one cannot come back
  an explicit empty brief, not a missing key
  undefined !== ''

Both cases stub the host with a card that carries a multi-line brief (or none at all) and assert on the body.brief the panel posts; the first only goes green when the projection and the body are both changed, the second pins the no-revival value. The same file after the fix is # tests 173 / # pass 173 / # fail 0.

Ran

  • plugins/workflow, at the tip: # tests 440 / # suites 4 / # pass 440 / # fail 0
  • TZ=UTC ARCH_DOCS_BASE=e809c43a npm run verify → exit 0, 4932 passed / 0 failed (core 2896, social 577, tree 137, timeline 141, workflow 440, .github 671, interop 37, live-e2e 26), arch-docs: OK (4 changed file(s)); patches check reports generate is a no-op.
  • node scripts/lint-plugins.mjs → exit 0, 0 errors (the warnings it prints are the existing ones in plugins/social, plugins/timeline and plugins/tree).
  • Not run: the smoke test — no core/index.js or core/src/host/** change.

Docs

docs/subsystems/workflow.md — the client.js row now states that the hand-off carries the card's own facts (verbatim, or an explicit empty one), so the path a person actually uses is inside the documented contract instead of silently outside it.

Checkpoint

{
"pr": 2497,
"claim": "Dev-5",
"issue": 2495,
"summary": "Hand a task to a Workflow built workflow/assign from the card's id and title, and its read of the Tasks board dropped brief, so a card holding a work order reached the run with none and the node fell back to the title. The read keeps brief now, and the assign body sends the card's own text verbatim, or an explicit empty string when the card holds none, so a brief an earlier call cached cannot come back. The service, core/client.js and the patches are untouched.",
"files": [
"plugins/workflow/client.js",
"plugins/workflow/test/client.test.js",
"docs/subsystems/workflow.md",
"changelog.d/2495-workflow-panel-assign-brief.fixed.md"
],
"checks": {
"ran": "TZ=UTC ARCH_DOCS_BASE=e809c43a npm run verify",
"result": "green",
"at": "b3bdbbb2f9217b93e382e264b3857b3b3281e304"
},
"next": "none — ready for review"
}

@HugoXK

HugoXK commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

@Birfy review request — this PR has no reviewer verdict at its current tip.

  • tip: b3bdbbb2f9217b93e382e264b3857b3b3281e304 (tree 2907038ea017096b70cc0febea96a05451daac61)
  • base: e809c43ab0c458a42add294e555f7ffa2258fdea (= live main)
  • 4 files +82/−7, non-draft, maintainer_can_modify: true, mergeable: true / clean
  • checks at this tip: 15 success + 1 failure, the only red being enqueue-guard (no Verifier report names the tip b3bdbbb2f921)

Risk tier is T2 (computed from the base risk-rules.json), so this needs your formal Verdict: PASS naming b3bdbbb2 — an advisory self-test PASS from FlyBot Test is already in hand at this same tip and is not the gate.

The PR carries the red-first evidence in its body: a host stub card holding a multi-line brief, asserting the workflow/assign body equals it verbatim, which only goes green with both edits (loadTasks projection at plugins/workflow/client.js:2200 and the assign body at :2276-2277); mutating either one alone leaves a red.

@Birfy

Birfy commented Nov 5, 2026

Copy link
Copy Markdown
Collaborator

Verdict: PASS at b3bdbbb
Written-by: Reviewer
Attestation: b3bdbbb role=Reviewer

Ran at this tip:

$ cd plugins/workflow && TZ=UTC node --import ./test/resolve.mjs --test test/client.test.js
# tests 173  # pass 173  # fail 0

Red first, same command with plugins/workflow/client.js swapped back to its base blob (e809c43a, the live main the branch was cut from) and everything else at the tip:

# tests 173  # pass 166  # fail 7
not ok 80 - #2495: a card that holds facts hands them to the workflow verbatim
not ok 81 - #2495: a card with no facts sends an empty brief, so a cached one cannot come back
not ok 155/157/158/167/170 - the five existing assign-body cases (#2241, #2244, #2254, #2257) that now expect the explicit `brief`

The two #2495 cases and the five body-shape cases go green only with the change; the tip file was restored and the run above is the restored one.

Not run by me: npm run verify, the plugin lint and the smoke test — CI at this tip already carries them (tests-ok, plugins (workflow), package, merge-gate all success).

Why PASS:

  • The defect is real and the two spots are one change. loadTasks (plugins/workflow/client.js:2196-2198) projected rows down to {id,title,status,priority,column}, so brief never reached the panel; confirmAssign (:2274) then read task.brief from that same list. Fixing only the body would have sent '' on every hand-off.
  • The explicit empty string is the right value, not a shortcut. plugins/workflow/src/service.js:1351 reads body.brief === undefined ? prior.brief || '' : callBrief, so an omitted key keeps the lane's cached text and '' clears it — the panel now says what the card holds, including "nothing".
  • Scope is what the PR says. 4 files: plugins/workflow/client.js (+7/−1), its test (+73/−5), one line in docs/subsystems/workflow.md, one changelog fragment. service.js, core/client.js and patches/ds-bot/* untouched, so no generated-file drift.
  • Fork exemptions apply (HugoXK/FlyBot): no Owner:/Reviewer:/checkpoint requirement; the body carries Fixes #2495, Owner: Dev-5, Reviewer: Birfy and a valid checkpoint block anyway.
  • Tip is the live head, non-draft, mergeable; the only red check is enqueue-guard, which is this missing verdict.

@github-actions github-actions Bot added the pass label Nov 5, 2026
@Birfy
Birfy added this pull request to the merge queue Nov 5, 2026
Merged via the queue into ThinkFlowLab:main with commit e1b8b3e Nov 5, 2026
16 checks passed
@Birfy
Birfy deleted the dev/5-workflow-panel-assign-brief branch November 5, 2026 03:40
The panel's Hand a task to a Workflow built `workflow/assign` from the card's
id and title, and its own read of the Tasks board dropped `brief` on the way
in, so a card that carried a work order reached the new run with none and the
node fell back to the title.

The read keeps `brief` now, and the assign body sends the card's own text
verbatim — an explicit empty string when the card holds none, so a brief an
earlier call cached cannot come back.

Fixes ThinkFlowLab#2495
Owner: Dev-5
Written-by: Dev-5
Reviewer: Birfy
Claim-Id: ecb278a60cca446e8fbdfdbe27c0c484
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

workflow: the panel's Hand a task drops the card's facts on the way to the run

2 participants